import wx

class MyWindow(wx.Frame):
    def __init__(self, parent, title):
        super().__init__(parent, id=wx.ID_ANY, title=title,
                         size=(800, 600))

        # 创建菜单栏
        menu_bar = wx.MenuBar()
        file_menu = wx.Menu()
        exit_item = file_menu.Append(wx.ID_EXIT, "E&xit", "Exit the program")
        menu_bar.Append(file_menu, "&File")

        # 设置菜单栏
        self.SetMenuBar(menu_bar)

        # 显示窗口
        self.Show(True)

if __name__ == "__main__":
    app = wx.App()
    frame = MyWindow(None, "Hello, wxPython!")
    app.MainLoop()